<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      background-color: #3b3b98;
      
      color: #FFF;
      display: flex;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 10px;
      min-height: 100vh;
    }

    p {
      margin: 5px 0;
    }

    h2 {
      margin: 10px 0 20px;
      text-align: center;
    }

    input[type="checkbox"] {
      margin-right: 0;
    }

    .container {
      background-color: #23235b;
      box-shadow: 0px 2px 10px rgba(255, 255, 255, .2);
      padding: 20px;
      width: 350px;
      max-width: 100%;
    }

    .result-container {
      background-color: rgba(0, 0, 0, .4);
      display: flex;
      justify-content: flex-start;
      align-items: center;
      position: relative;
      font-size: 18px;
      letter-spacing: 1px;
      padding: 12px 10px;
      height: 50px;
      width: 100%;
    }

    .result-container #result {
      word-wrap: break-word;
      max-width: calc(100% - 40px);
    }

    .result-container .btn {
      font-size: 20px;
      position: absolute;
      top: 5px;
      right: 5px;
      height: 40px;
      width: 40px;
    }

    .btn {
      border: none;
      color: #FFF;
      cursor: pointer;
      font-size: 12px;
      background-color: #3b3b98;
    }

    .btn-large {
      display: block;
      width: 100%;
    }

    .setting {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 15px 0;
    }

    @media screen and (max-width: 400px) {
      .result-container {
        font-size: 14px
      }
    }
  </style>
</head>

<body>

  <div class="container">
    <h2>随机密码生成器</h2>
    <div class="result-container"><span id="result"></span><button class="btn" id="clipboard"
        style="font-size: 12px;">复制</button></div>
    <div class="settings">
      <div class="setting"><label>密码长度</label><input type="number" id="length" min="4" max="20" value="20" /></div>
      <div class="setting"><label>包含大写字母</label><input type="checkbox" id="uppercase" checked /></div>
      <div class="setting"><label>包含小写字母</label><input type="checkbox" id="lowercase" checked /></div>
      <div class="setting"><label>包含数字</label><input type="checkbox" id="numbers" checked /></div>
      <div class="setting"><label>包含符号</label><input type="checkbox" id="symbols" checked /></div>
    </div><button class="btn btn-large" id="generate">生成密码</button>
  </div>
</body>

</html>